package com.kaifamiao.annotation.enums;

public enum MaritalStatus {
    MARRIED( "T" ) ,
    UNMARRIED( "F" ) ;

    private String status ;

    MaritalStatus( String status ){
        this.status = status ;
    }

    public String getStatus(){
        return this.status ;
    }

    public static MaritalStatus parse( String status ){
        if( MARRIED.status.equals( status ) ) {
            return MARRIED ;
        }

        if( UNMARRIED.status.equals( status ) ) {
            return UNMARRIED ;
        }

        throw  new IllegalStateException( "不存在的枚举类型" );
    }

}
